/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 87111
 * Date: 2025-05-18
 * Time: 11:11
 */
//创建的猫类
class Cat {
    //成员变量
    public String catName;
    public int catAge;
    public String catKind;

    //构造方法
    public Cat(String catName, int catAge, String catKind) {
        this.catName = catName;
        this.catAge = catAge;
        this.catKind = catKind;
    }

    //    public Cat() {
//        this.catName = "小花";
//        this.catAge = 7;
//        this.catKind = "花猫";
//        //this("小花",7,"花猫");
//    }
//    public Cat(String catName,int catAge,String catKind) {
//        this.catName = catName;
//        this.catAge = catAge;
//        this.catKind = catKind;
//    }
    public void setCat(Cat this,String catName,int catAge,String catKind) {
        this.catName = catName;
        this.catAge = catAge;
        this.catKind = catKind;
    }
    public void printCat() {
        System.out.println(this.catName + " " + this.catAge + " " + this.catKind);
    }

    //成员方法
    public void eat() {
        System.out.println("吃");
    }
    public void run() {
        System.out.println("跑");
    }
}

public class Test1 {
    public static int add(int x,int y) {
        int z = x + y;
        return z;
    }
    public static void main(String[] args) {
        for (int i = 0; i < 50; i++) {
            System.out.print(i + " ");
        }

        int a = 10;
        System.out.println(a);
        int b = add(10,20);
        System.out.println(b);
    }
}


//类的实例化，创建类的对象
        //Cat cat = new Cat("小花",7,"花猫");
          //Cat cat1 = new Cat();
        //访问成员变量
//        System.out.println(cat.catName);
//        System.out.println(cat.catAge);
//        System.out.println(cat.catKind);
        //访问成员方法
//        cat.run();
          //设置成员变量的值
//        cat.catName = "小花";
//        cat.catAge = 7;
//        cat.catKind = "花猫";

//        cat.setCat("小花",7,"花猫");
//        cat.printCat();
//        cat1.setCat("小白",6,"波斯猫");
          //cat1.printCat();
